home *** CD-ROM | disk | FTP | other *** search
Wrap
XSetup plugin | 2003-08-02 | 7.2 KB | 264 lines
"FILE"="Xteq Systems X-Setup Plugin 6.0" "TYPE"="8" "COUNT"="2" "UIPATH 1"="System\AutoPlay\Handler Assignment" "NAME"="Handler Assignment for Picture CDs" "OSVERSION"="0000011" "VERSION"="1.03" "LANGUAGE"="VBScript" "TEXT 1"="Show Info" "TEXT 2"="Enable/Disable" "DESCRIPTION 1"="When Windows detects a CD-ROM (or any other media) which does not contain an AUTORUN.INF normally needed for AutoPlay, Windows will check if there are any "handlers" available that can "handle" the contents of the CD-ROM. "DESCRIPTION 2"="For example, when you insert a Video-CD usually does not contain an AUTORUN.INF, Windows will check if there is one or more handlers registered to handle this Video-CD. If so, a window will pop up displaying the registered handlers so you can easily choose one. You can also select one of these handlers as the default selection for the current type of CD-ROM. "DESCRIPTION 3"="With this plug-in you can view which handlers are assign to the CD type and also change them. Click "Show Info" to see which command is executed when you select a handler or click "Enable/Disable" to activate or disable a handler. When you just have added a customer handler, you will find it at the end of the list as "X-Setup AutoPlay CustomHandlerX". "DESCRIPTION 4"="IMPORTANT: The AutoPlay window (where you can select one of the activated handlers) will _NOT_ show up if either a default handler is set, or only one handler is defined. "DESCRIPTION 5"="To reset the list of default handlers, use the "Reset AutoPlay Default Handler Selection" plug-in inside the folder "Troubleshooting". "AUTHOR"="Xteq Systems" "CONTACTURL"="http://www.xteq.com" "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved" "COMMENT 1"=" " '/*** MAIN TEMPLATE IS THIS FILE ***/ '/*** ONLY CHANGE REGISTRY KEYS BELOW ***/ C_CD_EVENT="ShowPicturesOnArrival" '///////////////////////////////// '///*** NO CHANGES BELOW HERE ***/ sP="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\" & C_CD_EVENT & "\" XSET_GCHI_Name="" XSET_GCHI_EXE="" sPD1="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\" sPClass="HKLM\Software\Classes\" sInvoke1="\InvokeProgid" sInvoke2="\InvokeVerb" sInvokeA="\ProgID" sInvokeB="\InitCmdLine" Dim ary1() Dim ary2() Dim iReadAllCount sActive=" [ACTIVE] " Sub Plugin_Initialize iReadAllCount=0 Call ReloadAll End Sub Sub ReloadAll for i=1 to iReadAllCount Call SetUIElement(i,"") next i1=0 i1=RegEnumValues(sP) ReDim ary1(i1) i2=0 i2=RegEnumPaths(sPD1) ReDim ary2(i2) Call ReadAll(sP) Call ReadAllPaths(sPD1) iReadAllCount=1 for i=1 to i1 Call SetUIElement(iReadAllCount,sActive & ary1(i)) iReadAllCount=iReadAllCount+1 next for i=1 to i2 sName=ary2(i) bExists=false 'check if the handler already exists for e=1 to i1 if sName=ary1(e) then bExists=true exit for end if next if bExists=false then Call SetUIElement(iReadAllCount,ary2(i)) iReadAllCount=iReadAllCount+1 end if next End Sub Sub ReadAll(key) iC=RegEnumValues(key) if iC>0 then for l=1 to iC sName=RegEnumElement(l) ary1(l)=sName iReadAllCount=iReadAllCount+1 Next end if End Sub Sub ReadAllPaths(key) iC=RegEnumPaths(key) if iC>0 then for l=1 to iC sName=RegEnumElement(l) ary2(l)=sName iReadAllCount=iReadAllCount+1 Next end if End Sub Sub Plugin_CheckData(ElementIndex) End Sub Sub Plugin_Apply(ElementIndex,ElementSubIndex) if ElementSubIndex>0 then sName=GetUIElement(ElementSubIndex) sRealName="" bIsActivated=false if InStr(sName,sActive)>0 then sRealName=ary1(ElementSubIndex) bIsActivated=true else sRealName=sName end if if ElementIndex=1 then Call GetCommandNameAndExe(sRealName) Call MsgInformation("This item is called <" & XSET_GCHI_Name & "> and the command line that will be executed is <" & XSET_GCHI_Exe & ">") else if bIsActivated=true then Call RegDeleteValue(sP & sRealName) Call ReloadAll() else Call RegWriteValue(sP & sRealName,"",1) Call ReloadAll() end if end if end if End Sub Sub GetCommandNameAndExe(HandlerID) Dim sRegPath sRegpath=sPD1 & HandlerID sProgID=RegReadValue(sRegPath & sInvoke1) sVerb=RegReadValue(sRegPath & sInvoke2) '''Call DebugMsg("ProgID: " & sProgID) '''Call DebugMsg("sVerb: " & sVerb) if len(sProgID)=0 then sProgID=RegReadValue(sRegpath & sInvokeA) end if Call XSET_GetCOMHandlerInformation(sProgID,sVerb) End Sub Sub Plugin_Terminate End Sub '*** Get COM Handler Information Version 1.0 *** '*** WARNING! Requires several global variables: *** '*** XSET_GCHI_Name -> Name of the command *** '*** XSET_GCHI_EXE -> What will be executed *** Function XSET_GetCOMHandlerInformation(HandlerID,VerbID) XSET_GCHI_Local_C_BasePath="HKLM\Software\Classes\" XSET_GCHI_Local_C_CurVer="\CurVer\@" ''Call MsgInformation(HandlerID) 'save the handlerID XSET_GCHI_Local_Handler1=HandlerID 'construct reg path 1 XSET_GCHI_Local_Reg1=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\@" XSET_GCHI_Local_RegHandler=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\" 'get the default name XSET_GCHI_Local_Name1=RegReadValue(XSET_GCHI_Local_Reg1) 'now check if there is a newer version available XSET_GCHI_Local_Reg1=XSET_GCHI_Local_C_BasePath & HandlerID & XSET_GCHI_Local_C_CurVer 'get the newer version (if any) XSET_GCHI_Local_CurVer1=RegReadValue(XSET_GCHI_Local_Reg1) if IsEmpty(XSET_GCHI_Local_CurVer1)=false then 'damn it, there is a newer version available XSET_GCHI_Local_Handler1=XSET_GCHI_Local_CurVer1 'construct reg path XSET_GCHI_Local_Reg1=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\@" XSET_GCHI_Local_RegHandler=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\" 'read it XSET_GCHI_Local_Name2=RegReadValue(XSET_GCHI_Local_Reg1) 'check the names... if len(XSET_GCHI_Local_Name2)>0 then XSET_GCHI_Local_Name1=XSET_GCHI_Local_Name2 end if end if 'check if we have a name... if len(XSET_GCHI_Local_Name1)=0 then 'Okay, we do not have a name... XSET_GCHI_Local_Name1="COM:" & XSET_GCHI_Local_Handler1 end if '''Call MsgInformation(XSET_GCHI_Local_RegHandler) 'save this name XSET_GCHI_Name=XSET_GCHI_Local_Name1 'now check for the Command XSET_GCHI_Local_GetEXERegPath=XSET_GCHI_Local_C_BasePath & XSET_GCHI_Local_Handler1 & "\Shell\" & VerbID & "\command\@" '''Call MsgInformation(XSET_GCHI_Local_GetEXERegPath) XSET_GCHI_Local_GetEXE_Value=RegReadValue(XSET_GCHI_Local_GetEXERegPath) if IsEmpty(XSET_GCHI_Local_GetEXE_Value)=false then XSET_GCHI_EXE=XSET_GCHI_Local_GetEXE_Value else XSET_GCHI_EXE="UNKNOWN" end if ''Call MsgInformation("RES: " & XSET_GCHI_Local_Name1) ''Call MsgInformation("CMD: " & XSET_GCHI_EXE) End Function